// pages/community/community.js
Page({

        /**
         * 页面的初始数据
         */
        data: {
                statusBarHeight: 0,
                filterVisible: false,
                filterSelected: 2,
                filterOptions: {
                        1: {id: 1,name: '关注'},
                        2: {id: 2,name: '推荐'},
                        3: {id: 3,name: '附近'},
                },
                circle: [
                        {id: 1, name: '插画', image: 'https://cdn.supengjun.com/uploads/20240815/8b784ad93359c44cff11ec93d08fdeef.png'},
                        {id: 2, name: '音乐', image: 'https://cdn.supengjun.com/uploads/20240815/156005c5baf40ff51a327f1c34f2975b.jpg'},
                        {id: 3, name: '电影', image: 'https://cdn.supengjun.com/uploads/20240816/c89165c968d19ef48f396f823c5d57dd.jpg'},
                        {id: 4, name: '摄影', image: 'https://cdn.supengjun.com/uploads/20240816/d0096ec6c83575373e3a21d129ff8fef.jpg'},
                        {id: 5, name: '好物分享', image: 'https://cdn.supengjun.com/uploads/20240817/b8e99eaf8cfe9d7ae94554ece4a51a26.png'}
                ],
                goods: [
                        {
                                id: 1, 
                                type: 1,
                                title: '小程序性能优化课程基于实', 
                                icon: 'https://cdn.supengjun.com/uploads/20240815/8b784ad93359c44cff11ec93d08fdeef.png'
                        },
                        {
                                id: 2, 
                                type: 2,
                                title: '小程序性能优化课程基于实程序性能优化课程基于实际开2小程序性能优化课程基于实际开2小程序性能优化课程基于实际开2小程序性能优化课程基于实际开2小程序性能优化课程基于实际开2小程序性能优化课程基于实际开2小程序性能优化课程基于实际开2小程序性能优化课程基于实际开2小程序性能优化课程基于实际开2', 
                                icon: 'https://cdn.supengjun.com/uploads/20240815/156005c5baf40ff51a327f1c34f2975b.jpg'
                        },
                        {
                                id: 3, 
                                type: 1,
                                title: '小程序性能优化课程基于实际开发场景，提升小程序性能表现，满足用户体验3', 
                                icon: 'https://cdn.supengjun.com/uploads/20240816/c89165c968d19ef48f396f823c5d57dd.jpg'
                        },
                        {
                                id: 4, 
                                type: 1,
                                title: '小程序性能优化课程基于实际开发场景，提升小程序性能表现，满足用户体验4', 
                                icon: 'https://pic.sc.chinaz.com/Files/pic/pic9/202002/zzpic23327.jpg'
                        },
                        {
                                id: 5, 
                                type: 2,
                                title: '小程序性能优化课程基于实际开发场景，提升小程序性能表现，满足用户体验5', 
                                icon: 'https://cdn.supengjun.com/uploads/20240817/b8e99eaf8cfe9d7ae94554ece4a51a26.png'
                        },
                        {
                                id: 6, 
                                type: 1,
                                title: '小程序性能优化课程基于实际开发场景，提升小程序性能表现，满足用户体验5', 
                                icon: 'https://cdn.supengjun.com/uploads/20240817/b8e99eaf8cfe9d7ae94554ece4a51a26.png'
                        },
                        {
                                id: 7, 
                                type: 1,
                                title: '小程序性能优化课程基于实际开发场景，提升小程序性能表现，满足用户体验5', 
                                icon: 'https://cdn.supengjun.com/uploads/20240817/b8e99eaf8cfe9d7ae94554ece4a51a26.png'
                        },
                ]
        },

        /**
         * 生命周期函数--监听页面加载
         */
        onLoad(options) {
                const that = this;
                that.navBarComponent = that.selectComponent('#navBarComponent');
                that.setData({
                        statusBarHeight: that.navBarComponent.data.statusBarHeight
                });
                wx.request({
                  url: 'http://192.168.1.43:9502',
                })
        },

        /**
         * 生命周期函数--监听页面初次渲染完成
         */
        onReady() {

        },

        /**
         * 生命周期函数--监听页面显示
         */
        onShow() {

        },

        /**
         * 生命周期函数--监听页面隐藏
         */
        onHide() {

        },

        /**
         * 生命周期函数--监听页面卸载
         */
        onUnload() {

        },

        /**
         * 页面相关事件处理函数--监听用户下拉动作
         */
        onPullDownRefresh() {
                console.log('下拉');
                wx.startPullDownRefresh()
                setTimeout(() => {
                        wx.stopPullDownRefresh()
                      }, 2000)
        },

        /**
         * 页面上拉触底事件的处理函数
         */
        onReachBottom() {
                
        },

        /**
         * 用户点击右上角分享
         */
        onShareAppMessage() {

        },

        /**
         * 处理筛选可见
         */
        handleFilterVisible() {
                const that = this;
                that.setData({
                        filterVisible: !that.data.filterVisible
                });
        },

        handleFilterSelect(e) {
                const that = this;
                that.setData({
                        filterSelected: parseInt(e.currentTarget.dataset.id),
                        filterVisible: false
                });
        }
})